// Learn cc.Class:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const GameDataManger = require("../GameDataManger");


cc.Class({
    extends: cc.Component,

    properties: {
        coinLab:{    
            default:null,
            type:cc.Label
        },
    },
    onLoad(){
        cc.systemEvent.on('refresGame', this.refresh, this);
    },

    onEnable(){
        this.refresh();
    },

    refresh(){
        this.coinLab.string = GameDataManger.gold;
        //金币增加
    },

    onDisable(){
    },

    // update (dt) {},
});
